package com.opo5.logisticsmanagement.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.opo5.logisticsmanagement.common.MD5Utils;
import com.opo5.logisticsmanagement.dao.LoginDao;
import com.opo5.logisticsmanagement.domain.User;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

@SpringBootTest
public class LoginTestCase {
    @Autowired
    private LoginDao loginDao;

    @Autowired
    private AutoTaskService autoTaskService;

    @Test
    void testLogin(){
//        User u0 = new User();
//        u0.setNickname("zhangSan@qq.com");
//        u0.setPassword("123456");
//        User u = loginDao.findByNickname(u0);
//        System.out.println(u);
//        if (u!=null)
//            System.out.println(u.getUsername()+"---"+u.getPassword());
        User uu2 = new User();
        uu2.setNickname("admin");
        User uu = loginDao.findByNickname(uu2);
    }

    @Test
    void testMD5(){
        System.out.println(MD5Utils.encrypt("123qweopt",MD5Utils.MD5_KEY));
        System.out.println(MD5Utils.encrypt("123123",MD5Utils.MD5_KEY));
        System.out.println(MD5Utils.encrypt("123456",MD5Utils.MD5_KEY));
        LambdaQueryWrapper<User> qw = new LambdaQueryWrapper<>();
    }

}
